1. Field of the Invention
The present invention relates generally to a method for scaling a digital image, and more particularly to a method for scaling a digital image, i.e., for reducing or enlarging the digital image, for display in an embedded system.
2. Description of the Related Art
With the generalization of digital images, various sized and shaped of digital image apparatuses have been commercialized and introduced. A digital image apparatus such as a Digital TV, an HDTV (high definition television), a PDA (personal digital assistant), an IMT-2000 (international mobile telecommunications-2000) terminal, etc., provides clear images which a conventional analog image apparatus does not provide, and also provides various image processing functions, for example, division, enlargement, reduction, smoothing of images, or the like, which are possible only by digital image processing.
Many system sources are required to realize the various digital image processing functions as above. Therefore, in a digital TV, a DVD (digital video disc) player, etc., in which the power supply is sufficient and the size of the apparatus is large enough to realize digital image processing functions, various digital image processing functions can be realized without many difficulties. However, since an embedded system such as an IMT-2000 portable communication terminal station, a PDA, a digital camcorder, etc., is usually small in size, limited in power-supply, small in memory capacity, and the processing speed by its processor is slow, an embedded system has many limitations and many difficulties in realizing a digital image in its functions.
Image scaling technology for enlarging/reducing an image as one of the digital image processing functions is generally employed on an image input from a camera or applied to realize a partial enlargement function or PIP (picture in picture) function in a digital image output apparatus. However, image scaling is one of the most important technologies in solving the problem of interface between a standard video CODEC (coder/decoder) and various-sized LCD (liquid crystal display) devices as color/moving picture portable communication terminals are so common these days. The standard video CODEC is designed to support a QCIF (quadrature common interface format) size of 176×144. In contrast, the LCD devices are being produced in various sizes for image display according to the size of terminals or their production expenses, and thus, it can be produced in one of any number of sizes, varying from a small size, for example, 128×192, to a large size, for example, 240×240. Accordingly, the LCD devices are required to enlarge or reduce images to display the image output from a standard video CODEC on the image display of an LCD apparatus.
Image scaling technology to enlarge or reduce images as described above, is variegated and very complicated, and many methods of which are known. The variety of the methods result from the fact that the methods for maintaining the characteristics of a source image by enlargement/reduction are so various even when the image size is changed. However, image scaling technology suitable for a system having little system power, such as embedded systems, is not well known. This is due to the general recognition that image scaling technology is not suitable for embedded systems because the realization of the image scaling technology requires many operating processes. In processing in a pixel unit, a significant amount of processing is required in a real-time moving picture display because the image is output at a rate above 10 frames per second. Accordingly, image scaling technology for embedded systems has been neglected in the aspect of hardware because complicated hardware structures and high-powered systems are required to realize the image scaling function, based on the technologies, known up to now.
Further, when realizing an image scaling function through hardware, a flexible interface with applications was difficult to achieve compared with software because the realizing through hardware allows only a few set-up types. Unlike hardware, if realizing an image scaling function through software, various applications are allowed, for example, the control in a pixel unit in the input/output is possible, and there is no constriction in the structure design of application programming for LCD output. Also, image scaling with software provides a flexible interface with any kind of video CODEC and LCD input/output interface. However, the realization of a moving picture is impossible on embedded systems, even these with a considerably high performance chip, because of the large amount of processing.
When considering the above problems, it is preferable to realize the image scaling function on an embedded system through software, but the amount of processing for realization should be small enough not to burden the software. The most simple methods for realizing an image scaling function is that of reducing an image by down-sampling the pixels of a source image according to a scaling ratio and reducing the number of pixels, or that of enlarging an image by simply copying the pixels of a source image and increasing the number of pixels. The above technology can be described as follows in reference to FIG. 1, which illustrates an example of enlarging an image as an up-scaling.
In FIG. 1, to produce 9 enlarged image pixels from 3 source pixels, i.e. producing target pixels P1′˜P9′ from the source pixels P1˜P3, the target pixels P1′˜P3′ can be produced by copying the source image pixel P1, and the target pixels P4′˜P6′ can be produced by copying the source image pixel P2, and the target pixels P7′18 P9′ can be produced by copying the source image pixel P3. Accordingly, without processing, image size can be increased, but the quality of an enlarged image is significantly deteriorated because it is produced by simply copying the source pixels.
To improve the quality of an enlarged image, there is DDA (digital differential analyzer) algorithm of interpolation, which is processed by providing weight values by as much as a scaling ratio proportional to the image size of a target image to a source image. An example of up-scaling of enlarging images according to DDA algorithm will be described below in reference to FIG. 1. As illustrated in FIG. 1, to produce 9 target pixels P1′˜P9′ from 3 source pixels P1˜P3, the pixel values of target pixels P1′˜P9′ are in table 1 as follows.
TABLE 1P1′1/3 × P1P2′2/3 × P1P3′3/3 × P1P4′2/3 × P1 + 1/3 × P2P5′1/3 × P1 + 2/3 × P2P6′3/3 × P2P7′2/3 × P2 + 1/3 × P3P8′1/3 × P2 + 2/3 × P3P9′3/3 × P3
That is, the target pixels P1′˜P9′ can be produced by multiplying one or two adjacent source pixel values by a gradient (=⅓) which depends on the scaling ratio of the enlarged image size to the source image size and a weight value of a target pixel corresponding to the difference with an adjacent source pixel, and then summing the multiplied values. Accordingly, due to the reflection of adjacent source pixel values of a corresponding source pixel on target pixel values by the interpolation method, the quality of enlarged images are improved compared with the copy of source pixels, but high-quality of enlarged target images still cannot be expected because of simply multiplying the gradient and weight values according to the scaling ratio for source pixel values. Further, as the process includes division processing as well as multiplication processing, it still requires a large amount of processing.
As described above, an image scaling function for an embedded system preferably should be realized by software, and the amount of processing should be small enough to be realized by software. However, the image scaling technology by a small amount of processing still has many problems because the quality of scaled images is deteriorated, and even with the consideration of the image quality deterioration, it requires a large amount of processing. Therefore, the image quality deterioration should be minimized and the amount of processing should be decreased in embedded systems.